<!DOCTYPE html>
<html>
<head>
    <th:block th:replace="/layout/head"></th:block>
    <title>测试项目一览</title>
    <script th:src="@{/lib/easyui/datagrid-dnd.js}"></script>
    <script th:src="@{/lib/jQuery.md5.js}"></script>
    <script th:src="@{/js/item_list.js}"></script>
</head>

<body style="overflow-y:hidden">
<div style="width:100px;float:right">
    <div class="easyui-panel">
        <a href="#" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-more',width:'100%'">菜单</a>
    </div>
    <div id="mm1" style="width:150px;">
        <div data-options="iconCls:'fa fa-home'" th:href="@{'/page_list?projId=' + ${projId}}">返回</div>
        <div class="menu-sep"></div>
        <th:block th:if="${editable==1}">
            <div data-options="iconCls:'fa fa-plus'" onclick="javascript:newItem()">添加测试项</div>
            <div data-options="iconCls:'fa fa-arrow-right'" onclick="javascript:insertItem()">插入测试项</div>
            <div data-options="iconCls:'fa fa-minus'" onclick="javascript:delItem()">删除测试项</div>
            <div class="menu-sep"></div>
            <div data-options="iconCls:'fa fa-cogs'" onclick="javascript:importItem()">批量导入</div>
            <div class="menu-sep"></div>
        </th:block>
        <div data-options="iconCls:'fa fa-sign-out'" th:href="@{/logout}">退出</div>
    </div>
</div>
<div style="margin:0 auto;width:100%">
    <h2><span th:text="${pageName}"></span>－测试项目一览</h2>
    <table id="item_table"></table>
</div>

<div id="editDlg1" class="easyui-dialog" style="width:580px;top:100px" data-options="buttons:'#btns1',closed:true,modal:true,title:'测试条件'">
    <div style="margin-left:30px;margin-top:20px">
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="group1" style="width:500px;height:40px" data-options="label:'分组一:',multiline:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="group2" style="width:500px;height:40px" data-options="label:'分组二:',multiline:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="condition1" style="width:500px;height:70px" data-options="label:'前置条件:',multiline:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="condition2" style="width:500px;height:70px" data-options="label:'步骤描述:',multiline:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="expectation" style="width:500px;height:70px" data-options="label:'期望结果:',multiline:true"/>
        </div>
    </div>
</div>
<div id="btns1" style="display:none">
    <a href="#" class="easyui-linkbutton" style="width:80px;float:left" onclick="$('#editDlg1').dialog('close')">取消</a>
    <a href="#" class="easyui-linkbutton" style="width:80px" onclick="submitForm1()">保存</a>
</div>
<div id="editDlg2" class="easyui-dialog" style="width:600px;top:120px" data-options="buttons:'#btns2',closed:true,modal:true,title:'测试结果'">
    <div style="margin-left:60px;margin-top:20px">
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="testDate" style="width:450px" data-options="label:'测试日期:',readonly:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="tester" style="width:450px" data-options="label:'测试者:',readonly:true"/>
        </div>
        <div style="margin-bottom:20px">
            <select id="result" class="easyui-combobox" style="width:450px" data-options="label:'测试结果:',editable:false,panelHeight:100">
                <option value="OK">OK</option>
                <option value="NG">NG</option>
                <option value="WT">WT</option>
            </select>
        </div>
        <div style="margin-bottom:20px">
            <select id="category" class="easyui-combobox" style="width:450px" data-options="label:'故障分类:',editable:false,panelHeight:200">
                <option value="0">无</option>
                <option value="A">致命错误</option>
                <option value="B">严重错误</option>
                <option value="C">一般性错误</option>
                <option value="D">较小错误</option>
                <option value="E">建议或新需求</option>
            </select>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="desc" style="width:450px;height:70px" data-options="label:'故障描述:',multiline:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="cause" style="width:450px;height:70px" data-options="label:'故障原因:',multiline:true"/>
        </div>
    </div>
</div>
<div id="btns2" style="display:none">
    <a href="#" class="easyui-linkbutton" style="width:80px;float:left" onclick="$('#editDlg2').dialog('close')">取消</a>
    <a href="#" class="easyui-linkbutton" style="width:80px" onclick="submitForm2()">保存</a>
</div>
<div id="editDlg3" class="easyui-dialog" style="width:600px;top:200px" data-options="buttons:'#btns3',closed:true,modal:true,title:'结果确认'">
    <div style="margin-left:60px;margin-top:20px">
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="cfmDate" style="width:450px" data-options="label:'确认日期:',readonly:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="confirmer" style="width:450px" data-options="label:'确认者:',readonly:true"/>
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" id="cfmResult" style="width:450px;height:70px" data-options="label:'确认结果:',multiline:true"/>
        </div>
    </div>
</div>
<div id="btns3" style="display:none">
    <a href="#" class="easyui-linkbutton" style="width:80px;float:left" onclick="$('#editDlg3').dialog('close')">取消</a>
    <a href="#" class="easyui-linkbutton" style="width:80px" onclick="submitForm3()">保存</a>
</div>

<input type="hidden" id="editable" th:value="${editable}"/>
<input type="hidden" id="projId" th:value="${projId}"/>
<input type="hidden" id="pageId" th:value="${pageId}"/>
<input type="hidden" id="itemId"/>
</body>
</html>